//package com.ruoyi.utils;
//
//import com.aliyuncs.DefaultAcsClient;
//import com.aliyuncs.IAcsClient;
//import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest;
//import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse;
//import com.aliyuncs.exceptions.ClientException;
//import com.aliyuncs.profile.DefaultProfile;
//import com.aliyuncs.profile.IClientProfile;
//import com.microsoft.sqlserver.jdbc.StringUtils;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
///**
// * 阿里云短信服务工具类
// */
//public class SmsAliyunUtil {
//    private static final Logger log = LoggerFactory.getLogger(SmsAliyunUtil.class);
//
//    // 阿里云配置信息（建议配置到application.yml）
//    private static final String ACCESS_KEY_ID = "your_access_key_id";
//    private static final String ACCESS_KEY_SECRET = "your_access_key_secret";
//    private static final String SIGN_NAME = "瑞忆科技";
//    private static final String REGION_ID = "cn-hangzhou";
//
//    /**
//     * 发送短信验证码
//     * @param phoneNumber 接收手机号
//     * @param templateCode 短信模板ID
//     * @param templateParam 模板参数JSON字符串
//     * @return 是否发送成功
//     */
//    public static boolean sendSms(String phoneNumber, String templateCode, String templateParam) {
//        // 校验参数
//        if (StringUtils.isEmpty(phoneNumber) || StringUtils.isEmpty(templateCode)) {
//            log.error("短信发送失败：参数不完整");
//            return false;
//        }
//
//        try {
//            IClientProfile profile = DefaultProfile.getProfile(REGION_ID, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
//            IAcsClient client = new DefaultAcsClient(profile);
//
//            SendSmsRequest request = new SendSmsRequest();
//            request.setPhoneNumbers(phoneNumber);
//            request.setSignName(SIGN_NAME);
//            request.setTemplateCode(templateCode);
//            request.setTemplateParam(templateParam);
//
//            SendSmsResponse response = client.getAcsResponse(request);
//            return "OK".equalsIgnoreCase(response.getCode());
//        } catch (ClientException e) {
//            log.error("阿里云短信发送异常：{}", e.getMessage());
//            return false;
//        }
//    }
//}
